home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dobj / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-09  |  1.8 KB  |  100 lines

  1.  
  2. /*
  3.  *  DEFS.H
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  */
  9.  
  10. #ifdef AMIGA
  11. #include <exec/types.h>
  12. #include <exec/nodes.h>
  13. #include <exec/lists.h>
  14. #else
  15. #include <suplib/lists.h>
  16. #include <suplib/memory.h>
  17. #define __autoinit
  18. #endif
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22.  
  23. #define Prototype extern
  24.  
  25. #ifdef DEBUG
  26. #define dbprintf(pri,x) if (DDebug > pri) printf x
  27. #else
  28. #define dbprintf(pri,x)
  29. #endif
  30.  
  31. #ifdef _DCC
  32. #define cprintf printf
  33. #define csprintf sprintf
  34. #endif
  35.  
  36. #define MAXUNITS    512
  37. #define SMAX_BUF    256
  38. #define EWARN        1
  39. #define EERROR        2
  40. #define EFATAL        3
  41. #define ESOFT        4
  42.  
  43. typedef unsigned char ubyte;
  44. typedef unsigned short uword;
  45. typedef unsigned long ulong;
  46. typedef struct MinNode MinNode;
  47. typedef struct Node Node;
  48. typedef struct List List;
  49.  
  50. #ifdef AMIGA
  51. #include "/das/ops.h"
  52. #else
  53. #include "../das/ops.h"
  54. #endif
  55.  
  56. typedef struct ProgramUnit {
  57.     Node    pu_Node;
  58.     char    *pu_Name;
  59.  
  60.     int        pu_Offset;    /*  data/code offset    */
  61.     unsigned int pu_Size;    /*  size in bytes    */
  62.     unsigned int pu_Type;
  63. } ProgramUnit;
  64.  
  65. typedef struct RelocInfo {
  66.     MinNode    ri_Node;
  67.     struct Symbol   *ri_Sym;
  68.     short    ri_SrcHunk;
  69.     short    ri_DstHunk;
  70.     short    ri_RelocSize;
  71.     short    ri_RelocFlags;
  72.     int        ri_SrcOffset;
  73. } RelocInfo;
  74.  
  75. typedef struct Symbol {
  76.     MinNode    sm_Node;    /*  sorted by offset    */
  77.     short    sm_DefHunk;
  78.     unsigned int sm_Value;
  79.     unsigned int sm_CommonSize;
  80.     ubyte    sm_Type;
  81.     char    sm_Name[4];
  82. } Symbol;
  83.  
  84. #define RF_PCREL    0x0001
  85. #define RF_A4REL    0x0002
  86.  
  87. extern short NumHunks;
  88. /*extern long StartDo;*/
  89. /*extern long StartPc;*/
  90.  
  91. #ifdef NOTDEF
  92. extern void *GetSucc();
  93. extern void *GetPred();
  94. extern void *GetHead();
  95. extern void *GetTail();
  96. extern void *RemHead();
  97. #endif
  98.  
  99. #include "protos.h"
  100.